<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/tip.css" />
<script src="js/xheditor/jquery/jquery-1.4.4.min.js"></script>
<title>问卷管理__修改</title>
</head>
<?php // var_dump($allRule);?>
<body>
	<div id="wrap">
    	<div id="public_head"></div>
        <div class="m_search">
        	<form action='' method='post'>
                规则名称<input class="qi_text" name="r_name" type="text" value="<?php echo $rule;?>"/>
                <select class="select" name="r_state"><option value='0'>所有状态</option><option value='1' <?php if($state==1)echo 'selected';?>>有效</option><option value='2' <?php if($state==2)echo 'selected';?>>关闭</option></select>
                <input class="btn_search" name="sub_sel" type="submit" value="" />
        	</form>
            <div class="clear"></div>
        </div>
        <div class="m_content">
        	<table class="qi_table" width="0" border="0" cellpadding="0" cellspacing="1">
              <tr>
              	<th>规则名称</th>
              	<th>创建时间</th>
              	<th>状态</th>
              	<th>
              		作用范围
              	</th>
              	<th>问卷名称</th>
              	<th>操作</th>
              </tr>
              <?php 
              	if(count($allRule)>0){
              		foreach ($allRule as $v){
              ?>
              	<tr>
              		<td style="text-align:left;"><?php echo str_replace($rule, '<font color=red><b>'.$rule.'</b></font>&nbsp;', $v['TITLE']);?></td>
              		<td><?php echo $v['UPD_TIME']?></td>
              		<td><?php switch($v['STATE']){case '1':echo '有效';break;case '2':echo '关闭';break;}?></td>
              		<td>
						<?php 
							switch ($v['RLEVEL']){
								case '2':echo '(<font color=red>科室</font>)&nbsp;'.$allDep[$v['DEP_NO']];break;
								case '3':echo '(<font color=red>医生</font>)&nbsp;'.$allDoc[$v['DOC_NO']];break;
								default:echo '全院范围';break;
							}
						?>
					</td>
              		<td>
						<?php echo $allQuesnr[$v['QUES_ID']]?>
					</td>
              		<td>
              			<a href="/index.php?c=visitrule&a=edit&id=<?php echo $v['R_ID']?>">修改</a> 
              			<?php if($v['STATE']==1){?>
              			<a href="/index.php?c=visitrule&a=close&id=<?php echo $v['R_ID']?>" onclick="return T.confirm('确实要关闭吗？');"><span class='red'>关闭</span></a> 
              			<?php }else{?>
              			<a href="/index.php?c=visitrule&a=open&id=<?php echo $v['R_ID']?>"><font color='green'>启用</font></a> 
              			<?php }?>
              			<a href="/index.php?c=visitrule&a=del&id=<?php echo $v['R_ID']?>" onclick="return T.confirm('确实要删除吗？');"><font color='gray'>删除</font></a>
              		</td>
              	</tr>
              <?php 
              		}
              	}else{
              ?>
              	<tr height="40"><td style="text-align:center;color:green;" colspan='10'>没有您搜索的结果</td></tr>
              <?php }?>
              <tr><td colspan='10'>
					<?php 
						$url = '/index.php?c=visitrule&a=index&p=_num_&st='.$state.'&n='.urlencode($rule);
						echo JYTools::pager($url,$tolNum,$page,$pagesize);
					?>
			  </td></tr>
            </table>
        </div>
    </div>
</script>
</body>
</html>
<script src="/js/boot.js" type="text/javascript"></script>
<script src="/js/tip.js" type="text/javascript"></script>
<script src="/js/add_public_head.js" type="text/javascript"></script>